﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using AutoFacUtils;
using CashFlow.Web.Filters;
using CashFlow.Web.Common;
using CashFlow.Web.Areas.SystemManage.Validator.User;
using CashFlow.Web.Areas.SystemManage.Models.User;
using CashFlow.Web.Areas.SystemManage.Models.User.Result;
using IUserService3 = CashFlow.Web.Areas.SystemManage.Service.IUserService;

namespace CashFlow.Web.Areas.SystemManage.Controllers
{
    [RootUserFilter]
    public class UserController : Controller
    {
        private IUserService3 GetUserService3() { return AutoFacHelper.Get<IUserService3>(); }

        [HttpPost]
        [ValidatorFilter(typeof(QueryUserInfoModelValidator))]
        public ActionResult QueryByPhone(QueryUserInfoModel model)
        {
            var service3 = GetUserService3();
            var entity = service3.QueryByPhone(model.Phone);
            var entity2 = entity ?? new UserInfoModel();
            return MyCommonTool.CreateOperationResult(true, "", entity2);
        }
    }
}